package io.awen.modules.sign.service;

import com.baomidou.mybatisplus.extension.service.IService;
import io.awen.common.utils.PageUtils;
import io.awen.modules.sign.entity.SignCarEntity;
import io.awen.modules.sign.entity.SignCarLonLatEntity;
import io.awen.modules.sign.entity.SignContainerEntity;
import io.awen.modules.sign.qo.SignCarModel;
import io.awen.modules.sign.qo.SignCarQo;

import java.util.Date;
import java.util.HashMap;
import java.util.List;

/**
 * 收运单位车辆信息表
 *
 * @author liu.wen
 * @email liu.wen@qq.com
 * @date 2022-08-10 00:47:08
 */
public interface SignCarService extends IService<SignCarEntity> {

    PageUtils queryPage(SignCarQo qo);

    List<SignCarEntity> realListByQo(SignCarQo qo);


    /**
     * 通过车牌号查询车辆
     */
    SignCarEntity getByCarNum(String carNum);


    /**
     * 通过 carId 在内存中获取对应车辆
     */
    SignCarEntity findCar(Long carId);

    /**
     * 发现离容器最近的车
     */
    SignCarEntity findNearestCar(SignContainerEntity container);

    void updateCarLonLat(SignCarLonLatEntity lonlat);

    int total(SignCarQo qo);

    void saveAndCache(SignCarEntity signCar);

    void updateAndCache(SignCarEntity signCar);

    SignCarEntity infoByDriver(Long userId);

    HashMap<Long, SignCarEntity> getCarMap();

    SignCarEntity getSignCarByClientId(String clientId);

    SignCarEntity getSignCarByCarNumberPlateFromCatch(String carNumber);

    /**
     * 清空车辆缓存
     */
    void clearCarMap();

    /**
     * 强制结束所有车辆的拉运任务
     *
     */
    void initCarStatusToNormal();

    /**
     * 获取当前在线车辆信息
     */
    List<SignCarEntity> getCarInfoFromJtt808();


    SignCarModel getCarCountToday();



}

